<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	
</body>
<script type="text/javascript">
	// 回调函数：把函数当做参数传到另一个函数内部区调用
	function t1(){
		console.log("执行了t1");
	}
	function t2(fn){
		console.log("t2内部:");
		fn();
	}
	t2(t1);
	// ---------------模拟定时器
	function yanshiqi(fn,time){
		var date=new Date();
		for(;;){
			var newDate=new Date();
			if (newDate-date>=time) {
				break;
			}
		}
		fn();
	}
	yanshiqi(function(){
		console.log(1);
	},1000);
	yanshiqi(function(){
		console.log(2);
	},1000);
	yanshiqi(function(){
		console.log(3);
	},1000);

	// move.js
</script>
</html>